package everyday;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class T2418 {
    public String[] sortPeople(String[] names, int[] heights) {
        int n = names.length;
        Integer[] index = new Integer[n];
        for (int i = 0; i < n; i++) {
            index[i] = i;
        }
        Arrays.sort(index,(a,b)->heights[b]-heights[a]);
        String[] str = new String[n];
        for (int i = 0; i < n; i++) {
            str[i] = names[index[i]];
        }
        return str;
    }
}
